class StudentsController < ApplicationController
  before_filter :set_user
  def set_user
    if session[:user].nil?
      redirect_to "/edu"
      flash[:notice]="请重新登陆"
    end
    @user = session[:user]
  end
  
  def kechengs
    
      active_scaffold :kecheng do |config|

        config.columns = [:kcm, :kcjs,:dagang,:rili,:tjsj,:rkjs] 
        config.list.columns.exclude :dagang,:rili

        config.actions.exclude :create ,:search,:live_serch
        config.actions.exclude :update,:delete

    #    config.actions.swap :search, :live_search
      end
    
    @user = User.find(params[:id])
    @kechengs = Kecheng.find(:all)
  end
  
end
